package com.jrauto.CarAppBackend.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jrauto.CarAppBackend.entity.CarMedia;
import com.jrauto.CarAppBackend.service.CarMediaService;
import com.jrauto.CarAppBackend.mapper.CarMediaMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author huimin
* @description 针对表【car_media(车辆图片和视频)】的数据库操作Service实现
* @createDate 2025-07-02 14:10:41
*/
@Service
public class CarMediaServiceImpl extends ServiceImpl<CarMediaMapper, CarMedia>
    implements CarMediaService{

        @Resource
        private CarMediaMapper carMediaMapper;
    /**
     * 根据车辆ID获取所有媒体信息
     * @param carId 车辆ID
     * @return 媒体列表
     */
    @Override
    public List<CarMedia> getMediaByCarId(Integer carId) {
        return carMediaMapper.selectMediaByCarId(carId);
    }
}




